import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 代理商信息
 */
@Entity('order_merchant')
export class OrderMerchantEntity extends BaseEntity {
  @Column({ comment: '商户名称' })
  merchantName: string;

  // 代理商中天系统ID
  @Column({ comment: '代理商中天系统ID', nullable: true })
  merchantId: string;
  
  // 代理商手机号
  @Column({ comment: '代理商手机号', nullable: true })
  merchantPhone: string;

  // 微信支付商务号
  @Column({ comment: '微信支付商务号', nullable: true })
  merchantBusiness: string;
  

  @Column({ comment: '商户描述', nullable: true, type: 'text' })
  merchantDescription: string;

  // 微信支付参数
  // {
  //   "key": "shbos20250421WechatPayDetailweix",
  //   "appid": "wx6b01843d1f2874b8",
  //   "mchid": "1713344906",
  //   "publicKey": "@baseDir/cert/apiclient_cert.pem",
  //   "notify_url": "http://tongren.joyballet.cn/api/app/order/order/handleWxPayNotify",
  //   "privateKey": "@baseDir/cert/apiclient_key.pem",
  //   "verifyPublicKey": "@baseDir/cert/apiclient_cert.p12"
  // }
  @Column({ comment: '微信支付参数', type: 'json', nullable: true })
  merchantPayParams: {
    appId: string;
    mchId: string;
    key: string;
    notify_url: string;
    publicKey: string;
    privateKey: string;
    verifyPublicKey: string;
    publicKeyPath: string;
    publicKeyString: string;
    isApiCert: string;
  };

}
